#!/bin/bash
THRESHOLD=90
USAGE=$(df -h / | awk '/\//{print $5}' | tr -d '%')
if [ $USAGE -gt $THRESHOLD ]; then
  echo "Disk space critical: $USAGE%" | mail -s "Disk Alert" admin@example.com
fi
